package com.devmindset.legoframework.usage.server.data;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

import com.devmindset.legoframework.usage.client.model.OrderItem;

/**
 * Mockup source for test order item objects.<br/><br/>
 * 
 * In non-sample scenario, this would be retrieved and mapped from
 * some kind of persistence storage, like database.
 * 
 * @author <a href="ice.penov@devmindset.com">Ice Penov</a>
 */
public class OrderItemData {

	private static List<OrderItem> records;

	public static List<OrderItem> getRecords() {
		if (records == null) {
			records = Arrays.asList(getNewRecords());
		}
		return records;
	}

	@SuppressWarnings("deprecation")
	private static OrderItem[] getNewRecords() {
		return new OrderItem[] {
				new OrderItem(0, 8805, "Anti Virus Suite", "Software", new Date(109,
						10, 20), 2, 50),
				new OrderItem(1, 4833, "USB Ergonomic Keyboard", "Hardware", new Date(
						109, 10, 13), 1, 99.99f),
				new OrderItem(2, 9551, "Lumbar Support Cushion", "Hardware", new Date(
						109, 1, 2), 1, 75),
				new OrderItem(3, 954, "USB Keyboard", "Hardware",
						new Date(109, 10, 20), 12, 34.99f),
				new OrderItem(4, 616, "Consulting Services", "Services", new Date(109,
						10, 10), 40, 100),
				new OrderItem(5, 8357, "Office Application Suite", "Software",
						new Date(109, 2, 5), 14, 30),
				new OrderItem(6, 4582, "Anti Virus Suite", "Software", new Date(109, 1,
						20), 22, 50),
				new OrderItem(7, 9373, "On-site Training", "Services", new Date(109,
						10, 20), 20, 100),
				new OrderItem(8, 9311, "Software Development Kit", "Software",
						new Date(109, 10, 10), 8, 249.99f),
				new OrderItem(9, 7806, "15 inch flat panel monitor", "Hardware",
						new Date(109, 11, 12), 4, 300),
				new OrderItem(10, 8620, "18 inch flat panel monitor", "Hardware",
						new Date(109, 10, 20), 2, 50),
				new OrderItem(11, 629, "Office Productivity Suite", "Software",
						new Date(109, 11, 11), 2, 64.99f),
				new OrderItem(12, 1264, "Office Productivity Suite", "Software",
						new Date(109, 12, 20), 2, 64.99f),
				new OrderItem(13, 7100, "USB Ergonomic Keyboard", "Hardware", new Date(
						109, 10, 20), 6, 99.99f),
				new OrderItem(14, 9647, "Consulting Services", "Services", new Date(
						109, 10, 21), 10, 100),
				new OrderItem(15, 8468, "USB Optical Mouse", "Hardware", new Date(109,
						10, 10), 5, 29.99f),
				new OrderItem(16, 9496, "Off-site Training", "Services", new Date(109,
						1, 1), 35, 80),
				new OrderItem(17, 5124, "USB Stereo Headset", "Hardware", new Date(109,
						10, 20), 1, 69.99f),
				new OrderItem(18, 1799, "Office Application Suite", "Software",
						new Date(109, 11, 2), 222, 30),
				new OrderItem(19, 7020, "Consulting Services", "Services", new Date(
						109, 10, 20), 100, 80) };
	}
}